package single.shop.web.freemarker.method;

import java.util.Calendar;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

/**
 * 分店选型名字更改兼容更改
 * 
 * @author Yinyt
 *
 */
public class SelectTypeName implements TemplateMethodModel
{

	private static final Logger log = LoggerFactory.getLogger(SelectTypeName.class);

	@Override
	public Object exec(List args) throws TemplateModelException
	{
		String trString = "";
		try
		{
			if (args.size() == 0)
			{
				// 返回当前时间
				return "";
			}
			if (args.size() == 1)
			{
				String p = (String) args.get(0);
			    trString = p.replaceAll(",", "|");  
			}
		} catch (Exception e)
		{
			log.error("exec exception, return current datetime - ", e);
			trString = (String) args.get(0);
		}
		return trString;
	}
}
